# encoding=utf-8
import urllib
import os
def download_app(url, filepath):
    print('download app')
    if os.path.exists(filepath):
        # return True
        os.remove(filepath)
    try:
        urllib.urlretrieve(url, filepath)
        return True
    except Exception as e:
        print('\tError retrieving the URL:', filepath,e)
        os.remove(filepath)
        return False